# Process raw weekly wage data got from BLS QCEW Database.
BEGIN {
  OFS = ","
  split("Qtr1 Qtr2 Qtr3 Qtr4 Annual", qtrs)
  print "County", "Year", "Quarter", "Wage"
}

{
  if ($1 ~ /\*Area/) {
    county = substr($2, 2)
    if ($4 ~ /County/) {
      county = county " " $3
    }
      next

  }
  if (NF == 6 && $1 ~ /^20[01][0-9]$/) {
    year = $1
    for(i=2; i<=NF; ++i) {
    
      split($i,w,"\(")
      print county, year, qtrs[i-1], w[1]
    }
  }
}
